﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;

namespace NTTDATA.BEENChina.ResultCertification.Util
{
    public class ImageConvert
    {
        public string ConvertToPngBase64(byte[] imageData)
        {
            MemoryStream ms = new MemoryStream(imageData);
            Image image = Image.FromStream(ms);

            MemoryStream newMs = new MemoryStream();
            image.Save(newMs, ImageFormat.Png);

            return Convert.ToBase64String(newMs.GetBuffer());

        }
    }
}
